export default function (words: boolean | string[]) {
  (function () {
    let text: string[] = ['富强', '民主', '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善'];
    if (typeof words !== 'boolean') text = words;
    let n = 0;
    document.body.addEventListener('click', function (t) {
      const o = text,
        i = document.createElement('span');
      'true' === (i.textContent = o[n]), (n = (n + 1) % o.length);
      const a = t.pageX;
      let r = t.pageY - 20;
      (i.style.cssText = `\n      z-index: 150;\n      top: ${r}px;\n      left: ${a - 20}px;\n      position: absolute;\n      font-weight: bold;\n      color: ${(function () {
        const t = '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f'.split(',');
        let e = '#';
        for (let n = 0; n < 6; n++) e += t[Math.floor(16 * Math.random())];
        return e;
      })()};\n      cursor: default;\n      font-size: inherit;\n      word-break: break-word;\n    `),
        this.appendChild(i);
      const l = new Date().getTime();
      let d = 1;
      window.requestAnimationFrame(function t() {
        r--, (d -= 0.02), (i.style.top = r + 'px'), (i.style.opacity = d + ''), new Date().getTime() - l < 600 ? window.requestAnimationFrame(t) : i.remove();
      });
    });
  })();
}
